//
//  BJJinPinClassViewController.m
//  DangXiao
//
//  Created by APPLE on 16/12/6.
//  Copyright © 2016年 APPLE. All rights reserved.
//

#import "BJJinPinClassViewController.h"
#import "BJJinPinClassTableViewCell.h"
#import "BJHeaderView.h"
#import "BJJingPinClassDetailViewController.h"//精品课堂详情

@interface BJJinPinClassViewController ()<UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, strong) UITableView *myTableView;

@end

@implementation BJJinPinClassViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"精品课堂";
    
}

#pragma mark ---- 设置TbaleView
- (void)initUI{
    BJHeaderView *VIEW = [[BJHeaderView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, BILIHEIGHT(280))];
    _myTableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight) style:(UITableViewStylePlain)];
    _myTableView.delegate = self;
    _myTableView.dataSource = self;
    _myTableView.backgroundColor = GrayLabel;
    _myTableView.tableHeaderView = VIEW;
    //    注册cell
    [_myTableView registerClass:[BJJinPinClassTableViewCell class] forCellReuseIdentifier:@"BJJinPinClassTableViewCell"];
    
    
    [self.view addSubview:_myTableView];
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 16;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    BJJinPinClassTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BJJinPinClassTableViewCell" forIndexPath:indexPath];
    
    
    return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return BILIHEIGHT(90);
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    BJJingPinClassDetailViewController *VC = [[BJJingPinClassDetailViewController alloc]init];
    [self.navigationController pushViewController:VC animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
